package com.invest.infra.excel.wrapper;

import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Workbook;

/**
 * Created by evan on 2016/7/19.
 */
public class ExCellStyleUtil {

    public static CellStyle defaultStyle(Workbook workbook){

        CellStyle defaultStyle = workbook.createCellStyle();
        defaultStyle.setFillForegroundColor(HSSFColor.WHITE.index);
        defaultStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
        defaultStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
        defaultStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
        defaultStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
        defaultStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
        defaultStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
        defaultStyle.setVerticalAlignment(HSSFCellStyle.ALIGN_CENTER);
        defaultStyle.setWrapText(true);
        return defaultStyle;
    }
}
